<template>
	<div class="school">
		<h2>学生名称：{{name}}</h2>
		<h2 class="qwe">学生年龄：{{myage}}</h2>
		<button>把学生名称给school组件</button>
	</div>
</template>

<script>
	export default {
		name: "Student",
		data() {
			return {
				name: "抱抱",
				myage: 19,
			};
		},
		mounted() {
			// console.log("sd"+this.$on)
			this.$bus.$emit('hello',this.name);
		}
		
	};
</script>

<style lang="less" scoped>
	.school {
		background-color: rgba(232, 147, 160, 0.5);
		margin: 10px 0;

		.qwe {
			font-size: 40px;
		}
	}
</style>
